package com.jdk.demo.io.so_rcvbufDemo;

import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;

public class Client {

	public static void main(String[] args) throws Exception {
		Socket socket = new Socket();
		System.out.println("begin " + socket.getReceiveBufferSize());
		socket.connect(new InetSocketAddress("localhost", 8088));
		System.out.println("end " + socket.getReceiveBufferSize());
		OutputStream outputSteam = socket.getOutputStream();
		for (int i = 0; i < 100; i++) {
			outputSteam.write((
					"123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					+ "123456789123456789123456789123456789123456789123456789123456789123456789123456789"
					).getBytes());
		}
		outputSteam.write("end!".getBytes());
		outputSteam.close();
		socket.close();
	}

}
